package com.ljm.boot.rabbitmq.producer;


import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

@Component
public class DirectCallback implements RabbitTemplate.ReturnsCallback , RabbitTemplate.ConfirmCallback {

    public void returnedMessage(ReturnedMessage returnedMessage) {
        //是否到达队列
        System.out.println( returnedMessage.getReplyCode());
    }



    public void confirm(CorrelationData correlationData, boolean b, String s) {

        //是否到达交换机
    }
}
